package sessions;

import java.util.List;

import javax.ejb.Remote;

import entities.Admin;
import entities.Skill;
import entities.SkillRequest;
import entities.User;
import exceptions.DuplicatedSkillException;
import exceptions.SkillRequestException;

@Remote
public interface SkillManagerRemote {

	/**
	 * @param fromUser
	 *            User entity
	 * @param toAdmin
	 *            Admin entity
	 * @param message
	 *            attached text
	 * @throws SkillRequestException
	 */
	public void request(User fromUser, Admin toAdmin, String message)
			throws SkillRequestException;

	/**
	 * @param username
	 *            Admin entity
	 * @return the list of incoming requests
	 */
	public List<SkillRequest> fetchIncoming(String username);

	/**
	 * @param username
	 *            User entity
	 * @return the list of outgoing requests
	 */
	public List<SkillRequest> fetchOutgoing(String username);

	/**
	 * @param id
	 * @return
	 */
	public SkillRequest fetch(int id);

	/**
	 * @param sr
	 *            SkillRequest to change status
	 */
	public void accept(SkillRequest sr);

	/**
	 * @param sr
	 *            SkillRequest to change status
	 */
	public void refuse(SkillRequest sr);

	/**
	 * @param name
	 *            name of the skill
	 * @throws DuplicatedSkillException
	 */
	public void addSkill(String name) throws DuplicatedSkillException;

	/**
	 * @param id
	 * @return
	 */
	public Skill fetchSkill(int id);

	/**
	 * @return
	 */
	public List<Skill> fetchAllSkills();

}
